export const rules = function(self) { // 正整数：'weight','countryId','height','luggageCount',"playDay"
	return {
		mobile: [
			// { required: true, message: '请输入手机号', trigger: 'blur,change' },
			{
				validator: (rule, value, callback) => {
					return self.$u.test.mobile(value);
				},
				message: '请输入正确的手机号',
				trigger: ['blur'],
			}
		], 
		qq: [// ^[1-9][0-9]{4,18}$
			{
				validator: (rule, value, callback) => {
					return (/^[1-9][0-9]{4,18}$/.test(value))
				},
				message: '请输入正确的qq号',
				trigger: ['blur'],
			}
		],
		weight: [
			{
				validator: (rule, value, callback) => {
					return self.$u.test.digits(value)
				},
				message: '体重单位是（kg），请输入正整数',
				trigger: ['change','blur'],
			}
		],
		height: [
			
			{
				validator: (rule, value, callback) => {
					return self.$u.test.digits(value)
				},
				message: '身高请输入正整数',
				trigger: ['change','blur'],
			},
			{
				validator: (rule, value, callback) => {
					return value < 300
				},
				message: '身高单位是(cm)，输入值不能大于300',
				trigger: ['change','blur'],
			},
		],
		countryId:[
			{
				validator: (rule, value, callback) => {
					return self.$u.test.digits(value)
				},
				message: '城市id请输入正整数',
				trigger: ['change','blur'],
			}
		],
		passengerCount: [
			{
				validator: (rule, value, callback) => {
					return self.$u.test.digits(value)
				},
				message: '出行人数请输入正整数',
				trigger: ['change','blur'],
			}
		],
		luggageCount: [
			{
				validator: (rule, value, callback) => {
					return self.$u.test.digits(value)
				},
				message: '行李数请输入正整数',
				trigger: ['change','blur'],
			}
		],
		playDay: [
			{
				validator: (rule, value, callback) => {
					return self.$u.test.digits(value)
				},
				message: '游玩天数请输入正整数',
				trigger: ['change','blur'],
			}
		],
		email: [
			{
				validator: (rule, value, callback) => {
					return self.$u.test.email(value);
				},
				message: '请输入正确的邮箱',
				trigger: ['blur'],
			}
		],
		idCardNumber: [
			{
				validator: (rule, value, callback) => {
					return self.$u.test.idCard(value);
				},
				message: '请输入正确的身份证号码',
				trigger: ['blur'],
			}
		]
	}
}